#define  _CRT_SECURE_NO_WARNINGS 1		
int pivotIndex(int* nums, int numsSize) {
    int i = 0;
    for (i = 0; i < numsSize; i++)
    {
        int flag = i;
        int sum1 = 0;
        int sum2 = 0;
        int j = 0;
        for (j = 0; j < flag; j++)
        {
            sum1 += nums[j];
        }
        for (j = flag + 1; j < numsSize; j++)
        {
            sum2 += nums[j];
        }
        if (sum1 == sum2)
        {
            return flag;
        }
    }
    return -1;
}
